seasonal_rain <- aggregate(rain~year+season, data = climate, FUN = sum)
winter_rain<- subset(seasonal_rain, season == 4)
season_temp <- aggregate(tmax~year+season, data = climate, FUN = mean)
summer_temp <- subset(season_temp, season == 2)
rain_temp <- merge(summer_temp, winter_rain, by = "year")
ggplot(rain_temp, aes(x=rain, y= tmax, group_by(year))) +
geom_point(size=0.8)+
geom_smooth(method=lm, se = FALSE, formula = y ~ x, color = "blue", size = 0.5)+
theme_bw()+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
xlab("Total Winter Precipitation")+
ylab("Mean Temperature")

Plot showing relationship between winter precipitation and summer temperature
linear_reg <-lm(rain ~ tmax, data=rain_temp)
summary(linear_reg)
##
## Call:
## lm(formula = rain ~ tmax, data = rain_temp)
##
## Residuals:
## Min 1Q Median 3Q Max
## -402.56 -167.86 -51.86 156.82 1019.19
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 986.37 560.93 1.758 0.0829 .
## tmax -20.48 24.67 -0.830 0.4091
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 263.1 on 73 degrees of freedom
## Multiple R-squared: 0.009355, Adjusted R-squared: -0.004216
## F-statistic: 0.6894 on 1 and 73 DF, p-value: 0.4091
The relationship between winter precipitation and summer temperature might be useful to know because while the above relationship is not significant there is a slightly negative relationship between winter precipitation and summer temperatures. This may be important particularly in dry years, as warmer temperatures and dry conditions may lead to a significant fire season.